#ifndef EVALUATE_H
#define EVALUATE_H

#include <QWidget>
#include <QButtonGroup>
#include <QGroupBox>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QRadioButton>
#include <QLabel>
#include <QPushButton>
#include <QComboBox>
#include <QMessageBox>
#include <QTableWidget>
#include "sql.h"
#include "user.h"

struct EvaluationCriteria
{
    QString title;
    QButtonGroup* group;
};

class EvaluationWidget : public QWidget
{
    Q_OBJECT

public:
    EvaluationWidget(QWidget *parent = nullptr);

private slots:
    void handleSubmit();
    void onCourseSelectionChanged();
    void showEvaluationResults(); // 新增函数

private:
    void loadCourses();
    QGroupBox *createEvaluationGroup(const QString &title, QButtonGroup *&group);
    void setupEvaluationGroups(const QString &userType);

    QPushButton *submitBtn;
    QPushButton *viewResultsBtn;
    QComboBox *courseCombo;
    QVector<EvaluationCriteria> evaluationCriterias;
    QVBoxLayout *evaluationLayout;
};

#endif // EVALUATE_H
